//
// Created by PC on 2022/11/14.
// 选择排序
//

#include <iostream>
#include <vector>
#include "arrUtil.h"
using namespace std;

int main()
{
   vector<int> v{9,8,7,6,5};
   randVector(v,10);
   int len = v.size();
   for (int i = 0; i <len; ++i)
    {
        int min_index = i;
        for (int j = i+1; j < len ; ++j)
        {
            min_index = v[j]<v[min_index]?j:min_index;
        }
        swapVector(v,min_index,i);
    }
   printVector(v);

}